<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>杨梅色彩美学代言</title>
        <script src="__INDEX__/js/mui.min.js"></script>
	<link rel="stylesheet" href="__INDEX__/css/mui.min.css">
    <link rel="stylesheet" href="__INDEX__/css/style.css" />
    <link rel="stylesheet" href="__INDEX__/css/yjia.css" />
    <link rel="stylesheet" href="__INDEX__/css/mall.css" />
</head>
<body>

	<div class="mui-content cp_content" style="padding-bottom: 60px;">
	   {include file="public/top" /}
	     {if isset($site)}{$site|html_entity_decode}
	    {else}
	    <img src="__INDEX__/images/b1.jpg?5=1" >
	    {/if}
	  
	</div>
	<nav class="mui-bar mui-bar-tab">
	    <a  href="javascript:buy(1)"><img src="__INDEX__/images/splb_btn.jpg"></a>
	</nav>
</body>
</html>
{include file="public/footer" /}
<script>
		function buy(type){
			var is_rz="{$user['is_rz']}";
			if(is_rz==1){
				layer.msg("您已经是会员了!");
				return ;
			}
			$.ajax({
			type:"post",
			data:{
				type:type
			},
			url:"/index/payment/mem_pay",
			success:function(data){
				data=JSON.parse(data);
				callpay(data);
			}
		});
	}
		//调用微信JS api 支付
		function jsApiCall(jsApiParameters) {
			WeixinJSBridge.invoke('getBrandWCPayRequest', jsApiParameters,
				function(res) {
					if(res.err_msg == "get_brand_wcpay_request:ok") {
						layer.msg('支付成功');
					window.location="/index/member";
					} else {
						layer.msg('支付失败');
					}
					//window.location="/index/member";
				}
			);
		}

		function callpay(jsApiParameters) {
			if(typeof WeixinJSBridge == "undefined") {
				if(document.addEventListener) {
					document.addEventListener('WeixinJSBridgeReady', jsApiCall(jsApiParameters), false);
				} else if(document.attachEvent) {
					document.attachEvent('WeixinJSBridgeReady', jsApiCall(jsApiParameters));
					document.attachEvent('onWeixinJSBridgeReady', jsApiCall(jsApiParameters));
				}
			} else {
				jsApiCall(jsApiParameters);
			}
		}
</script>